<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title></title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="../static/elderlyInfo/main/layui/css/layui.css" media="all">
<link rel="stylesheet" href="../static/elderlyInfo/main/css/thesame.css" media="all">
<link rel="stylesheet" href="../static/elderlyInfo/main/css/footer.css" media="all">
<link rel="stylesheet" href="../static/elderlyInfo/css/rightCon.css" media="all">
<link rel="stylesheet" href="../static/elderlyInfo/css/page.css" media="all">
<link rel="stylesheet" href="../static/elderlyInfo/css/popCss.css" media="all">



</head>

<body class="layui-layout-body">
	<input type="hidden" id="userNo" th:value="${elderlyInfoOfBase.elderlyInfo.userNo}">
	<div class="layui-body">
		<div class="add-title pad25px"><span onclick="back()" class="mr10px cursor"><img src="../static/elderlyInfo/img/return_icon.png"></span><span>查看信息</span></div>
		<!-- 内容主体区域 -->
		<div class="new-add-box new-add-box-width bgWhite box-shadows border-radius4">
			<div class="add-box-scroll">
				<div class="border-bot5px border-radius4 pad25px">
					<dl class="per-look-dl">
						<dt th:if="${ #strings.isEmpty(elderlyInfoOfBase.elderlyInfo.imgPath) }">
							<img src="../static/elderlyInfo/img/moren.png" class="block">
						</dt>
						<dt th:if="${ not #strings.isEmpty(elderlyInfoOfBase.elderlyInfo.imgPath) }">
							<img th:src="${elderlyInfoOfBase.elderlyInfo.imgPath}" class="block">
						</dt>

<!-- nursingCostNo -->
						<dd>
							<div class="overflow">
								<p class="left">
									<span th:text="${elderlyInfoOfBase.elderlyInfo.userName}"></span>
									<span th:text="${elderlyInfoOfBase.buildingInfo}" class="border-bggray"></span>
								</p>
								<p class="right">
									<span  th:if="${elderlyInfoOfBase.elderlyInfo.cognitionStatus != '否'}" class="border-bgred">认知问题</span>
									<span th:onclick="nursingLevelPicLayerOpen([[${elderlyInfoOfBase.nursingCostNo}]])" class="border-bgred cursor">




										<em th:text="${elderlyInfoOfBase.nursingCostName}"></em>
										<em class="look-em border-bgred textCenter">?</em>
									</span>
									<span class="border-bgred" th:text="${elderlyInfoOfBase.assessmentCostName}"></span>
								</p>
							</div>
							<div>
								<span th:text="${elderlyInfoOfBase.elderlyInfo.userSex}"></span>
								<span th:text="${elderlyInfoOfBase.elderlyInfo.age}+'岁'"></span>
								<span th:text="${elderlyInfoOfBase.elderlyInfo.education}"></span>
								<span th:text="${elderlyInfoOfBase.elderlyInfo.socialSecurityType}"></span>
								<span th:text="${elderlyInfoOfBase.elderlyInfo.liveAddress}"></span>
								<!-- <span>本科</span>
								<span>城保</span>
								<span>黄渡镇联西村135号</span> -->
								<!-- <p th:text="${userInfo.age}+'岁'"></p> -->
							</div>
							<div>
								<span class="border-bggreen"  th:text="'合同截止：'+${elderlyInfoOfBase.endDate}"  ></span>
								<span class="border-bggreen" th:text="'下次护理评估时间：'+${elderlyInfoOfBase.nextEffectDate}"></span>
								<span class="border-bggreen" th:text="'评估有效期：'+${elderlyInfoOfBase.validDate}"></span>
							</div>
						</dd>
					</dl>
				</div>
				<div>
					<div class="layui-tab layui-tab-time" style="margin: 10px 0 0;">
						<div class="layui-form">
							<ul class="layui-tab-title pl25px">
								<li value="1" class="layui-this">基本信息</li>
								<li th:if="${elderlyInfoOfBase.elderlyInfo.isNotice=='1'}"  value="2" class="current-tips" >养老院信息</li> 
								<li th:if="${elderlyInfoOfBase.elderlyInfo.isNotice!='1'}"  value="2"  >养老院信息</li> 
								 <!-- class="current-tips" -->
							</ul>
							<div id="isNotice" type="hidden" th:value="${elderlyInfoOfBase.elderlyInfo.isNotice}"></div>
						</div> 
						<div class="layui-tab-content bgWhite pad25px">
							<div class="layui-tab-item layui-show">
								<div class="mb25px">
									<div class="new-add-title relative overflow mb15px"><span class="ml15px">查看信息</span></div>
									<div class="new-add-con new-add-form pb25px border-bot1px">
										<article class="new-add-left new-add-form-con new-add-form-con-nowrap">
											<ul class="overflow">
												<li>
													<p><label>姓名：</label></p>
													<p th:text="${elderlyInfoOfBase.elderlyInfo.userName}"></p>
												</li>
												<li>
													<p><label>户籍类型：</label></p>
													<p th:text="${elderlyInfoOfBase.elderlyInfo.householdRegister}"></p>
												</li>
												<li>
													<p><label>性别：</label></p>
													<p th:text="${elderlyInfoOfBase.elderlyInfo.userSex}"></p>
												</li>
												<li>
													<p><label>籍贯：</label></p>
													<p th:text="${elderlyInfoOfBase.elderlyInfo.nativePlace}"></p>
												</li>
												<li>
													<p><label>年龄：</label></p>
													<p th:text="${elderlyInfoOfBase.elderlyInfo.age}+'岁'"></p>
												</li>
												<li>
													<p><label>职业：</label></p>
													<p th:text="${elderlyInfoOfBase.elderlyInfo.occupation}"></p>
												</li>
												<li>
													<p><label>民族：</label></p>
													<p th:text="${elderlyInfoOfBase.elderlyInfo.nation}"></p>
												</li>
												<li>
													<p><label>文化程度：</label></p>
													<p th:text="${elderlyInfoOfBase.elderlyInfo.education}"></p>
												</li>
												<li>
													<p><label>身份证号：</label></p>
													<p th:text="${elderlyInfoOfBase.elderlyInfo.userPid}"></p>
												</li>
												<li>
													<p><label>社保类型：</label></p>
													<p th:text="${elderlyInfoOfBase.elderlyInfo.socialSecurityType}"></p>
												</li>
												<li>
													<p><label>社保卡号：</label></p>
													<p th:text="${elderlyInfoOfBase.elderlyInfo.socialSecurityCardNo}"></p>
												</li>
												<li>
													<p><label>认知：</label></p>
													<p th:text="${elderlyInfoOfBase.elderlyInfo.cognitionStatus}"></p>
												</li>
												<li>
													<p><label>工作单位：</label></p>
													<p th:text="${elderlyInfoOfBase.elderlyInfo.retireCompany}"></p>
												</li>
												<li>
													<p><label>居住地址：</label></p>
													<p th:text="${elderlyInfoOfBase.elderlyInfo.liveAddress}"></p>
												</li>
											</ul>
										</article>
										<article class="new-add-right">
											<dl class="inline-block relative">
												<dt>
													<p class="filejs" th:if="${ #strings.isEmpty(elderlyInfoOfBase.elderlyInfo.imgPath) }">
														<img src="../static/elderlyInfo/img/moren.png" class="bock">
													</p>
													<p class="filejs" th:if="${not #strings.isEmpty(elderlyInfoOfBase.elderlyInfo.imgPath) }">
														<img th:src="${elderlyInfoOfBase.elderlyInfo.imgPath}" class="bock">
													</p>
													<input type="file" class="hidden file" />
												</dt>
												<!-- <dd class="white lh30px textCenter">默认头像</dd> -->
											</dl>
										</article>
									</div>
								</div>
								<div class="mb25px">
									<div class="new-add-title relative overflow mb15px"><span class="ml15px">紧急联系人</span></div>
									<div class="pb20px border-bot1px">
										<!-- <div class="mt25px mb15px lh32px overflow add-btn-input">
											<p class="left cursor">
												<span class="white border-radius4 bgGreen inline-block pl15px pr15px"><img src="../static/elderlyInfo/img/button_add.png">添加</span>
											</p>
										</div> -->
										<div class="border1px border-radius4">
											<!-- <table class="layui-hide" id="test1" lay-filter="test"></table> -->
											<table class="layui-table layui-table-header">
												<thead>
													<tr>
														<th>姓名</th>
														<th>手机号码</th>
													</tr>
												</thead>
												<tbody>
													<tr th:each="list:${elderlyInfoOfBase.elderlyInfo.userInfoContactList}" >
														<td><p><label  th:text="${list.contactName}"></label></p></td>
														<td><p><label  th:text="${list.mobile}"></label></p></td>
													</tr>

													<tr th:if="${#lists.isEmpty(elderlyInfoOfBase.elderlyInfo.userInfoContactList)}" >
														<td colspan="7">无联系人</td>
													</tr>
												</tbody>
											</table>
										</div>
									</div>
								</div>
								
							</div> 




							<div class="layui-tab-item ">
								<div th:if="${elderlyInfoOfBase.elderlyInfo.isNotice=='1'}" class="border-bgyellow lh40px pl15px pr15px"><img src="../static/elderlyInfo/img/icon_lb.png" class="mr10px" style="vertical-align: -2px;">医务室已经更新了护理评估信息，请及时更新！</div>

								<article class="mess-list">
									<nav class="border1px border-radius4 pad15px mt20px">
										<div class="new-add-title relative overflow mb15px">
											<p class="left"><span class="ml15px">费用情况</span></p>
											<p class="right">
												<span th:if="${elderlyInfoOfBase.elderlyInfo.isStayBack==1}" onclick="chargeLayerOpen()" class="ml15px cursor"><img src="../static/elderlyInfo/img/icon_xiugai.png" alt="">修改费用</span>
											</p>
										</div>
										<ul>
											<li>
												<p>
													<span>收费情况（元）：</span>
													<em class="red f18px fb" th:text="${elderlyInfoOfBase.elderlyInfo.costFee}"></em>
												</p>
											</li>
											<li>
												<p>
													<span>入住保证金（元）：</span>
													<em th:text="${elderlyInfoOfBase.elderlyInfo.inDeposit}"></em>
												</p>
											</li>
											<li>
												<p>
													<span>缴纳时间：</span>
													<em th:text="${elderlyInfoOfBase.elderlyInfo.paymentDate}"></em>
												</p>
											</li>
										</ul>
									</nav>
									<nav class="border1px border-radius4 pad15px mt20px">
										<div class="new-add-title relative overflow mb15px">
											<p class="left"><span class="ml15px">入住时间</span></p>
											<p class="right">
												<span th:if="${elderlyInfoOfBase.elderlyInfo.isStayBack==1}"  onclick="contractLayerOpen()" class="ml15px cursor"><img src="../static/elderlyInfo/img/icon_xiugai.png" alt="">修改合同</span>
												<span onclick="historyContractLayerOpen()" class="cursor"><img src="../static/elderlyInfo/img/icon_history.png" alt="">历史合同</span>
											</p>
										</div>
										<ul>
											<li>
												<p>
													<span>入住时间：</span>
													<em th:text="${elderlyInfoOfBase.startDate}"></em>
												</p>
												<p>
													<span>合同截止时间：</span>
													<em th:text="${elderlyInfoOfBase.endDate}"></em>
													<input type="hidden" id="oldEndDate" th:value="${elderlyInfoOfBase.endDate}" name="">
												</p>
												<p th:if="${elderlyInfoOfBase.elderlyInfo.isStayBack==2}">
													<span>退住时间：</span>
													<em th:text="${elderlyInfoOfBase.elderlyInfo.stayBackDate}"></em>
												</p>
												<p th:if="${elderlyInfoOfBase.elderlyInfo.isStayBack==2 && elderlyInfoOfBase.elderlyInfo.stayBackReason==1}">
													<span>死亡时间：</span>
													<em th:text="${elderlyInfoOfBase.elderlyInfo.deathDate}"></em>
												</p>
											</li>
										</ul>
									</nav>
									<nav class="border1px border-radius4 pad15px mt20px">
										<div class="new-add-title relative overflow mb15px">
											<p class="left"><span class="ml15px">房间信息</span></p>
											<p class="right">
												<span th:if="${elderlyInfoOfBase.elderlyInfo.isStayBack==1}" onclick="buildingRoomBedLayerOpen()" class="ml15px cursor"><img src="../static/elderlyInfo/img/icon_xiugai.png" alt="">更换床位</span>
												<span onclick="historyBedRecordLayerOpen()" class="cursor"><img src="../static/elderlyInfo/img/icon_history.png" alt="">历史床位</span>
											</p>
										</div>
										<ul>
											<li> 
												<p>
													<span>房间号：</span>
													<em  th:text="${elderlyInfoOfBase.buildingRoomBedInfo.roomName}"></em>
												</p>
												<p>
													<span>床位：</span>
													<em  th:text="${elderlyInfoOfBase.buildingRoomBedInfo.bedName}"></em>
												</p>
												<p>
													<span>床位费标准：</span>
													<em  th:text="${elderlyInfoOfBase.buildingRoomBedInfo.costPrice}"></em>
												</p>
											</li>
										</ul>
									</nav>
									<nav class="border1px border-radius4 pad15px mt20px">
										<div class="new-add-title relative overflow mb15px">
											<p class="left"><span class="ml15px">护理等级信息</span></p>
											<p class="right">
												<span th:if="${elderlyInfoOfBase.elderlyInfo.isStayBack==1}" onclick="nursingLayerOpen()" class="ml15px cursor"><img src="../static/elderlyInfo/img/icon_xiugai.png" alt="">更新等级</span>
												<span onclick="historyNursingRecordLayerOpen()" class="cursor"><img src="../static/elderlyInfo/img/icon_history.png" alt="">历史等级</span>
											</p>
										</div>
										<ul>
											<li>
												<p>
													<span>评估等级：</span>
													<em th:text="${elderlyInfoOfBase.nursingCostName}"></em>
												</p>
												<p>
													<span>护理评估生效日期：</span>
													<em th:text="${elderlyInfoOfBase.nursingEffectDate}"></em>
												</p>
												<p>
													<span>护理人员：</span>
													<em th:text="${elderlyInfoOfBase.staffName}"></em>
												</p>
											</li>
										</ul>
									</nav>
									<nav class="border1px border-radius4 pad15px mt20px">
										<div class="new-add-title relative overflow mb15px">
											<p class="left"><span class="ml15px">长护险等级信息</span></p>
											<p class="right">
												<span th:if="${elderlyInfoOfBase.elderlyInfo.isStayBack==1}" onclick="assessmentLayerOpen()" class="ml15px cursor"><img src="../static/elderlyInfo/img/icon_xiugai.png" alt="">更新评估</span>
												<span onclick="historyAssessmentRecordLayerOpen()" class="cursor"><img src="../static/elderlyInfo/img/icon_history.png" alt="">历史评估</span>
											</p>
										</div>
										<ul>
											<li>
												<p>
													<span>评估等级：</span>
													<em th:text="${elderlyInfoOfBase.assessmentCostName}"></em>
												</p>
												<p>
													<span>评估有效期：</span>
													<em th:text="${elderlyInfoOfBase.validDate}"></em>
												</p>
											</li>
										</ul>
									</nav>
								</article>
							</div> 
						</div> 
					</div> 
				</div>
			</div>
		</div>
	</div>
	<div id="baseInfoDiv" class="layui-footer layui-footer-one">
		<div class="btn-con textCenter">
			<span class="btn-one cursor" onclick="backList()">返回列表</span>
			<span th:if="${elderlyInfoOfBase.elderlyInfo.isStayBack==1}" class="btn-two cursor" onclick="updateElderlyInfo()">编辑</span>
		</div>
	</div>


	<div id="beadHouseDiv" style="display: none;" class="layui-footer layui-footer-one">
		<div class="btn-con textCenter">
			<span class="btn-one cursor" onclick="backList()">返回列表</span>
			<span th:if="${elderlyInfoOfBase.elderlyInfo.isStayBack==1}" class="btn-two cursor" onclick="isStayBackLayerOpen()">办理退住</span>
		</div>
	</div>




	<!-- 收费信息编辑弹窗 -->
	<div id="pop-chargeLayerOpen" style="display: none;">
		<div class="pop-up">
			<div>
				<div class="pop-title relative overflow mb15px">
					<span class="ml15px">收费情况</span>
					<p class="right"><img src="../static/elderlyInfo/img/close_icon.png" class="block pop-close"><p>
				</div>
				<div class="pop-form pop-form-nurse mt30px mb30px">
					<div class="layui-form-item">
						<label class="layui-form-label border-box"><span class="red">*</span>收费情况（元）：</label>
						<div class="layui-input-block">
							<input id="costFee" onkeyup="changeNum(this);" type="text" placeholder="请输入" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label border-box"><span class="red">*</span>入住保证金（元）：</label>
						<div class="layui-input-block">
							<input id="inDeposit" onkeyup="changeNum(this);" type="text" placeholder="请输入" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label border-box"><span class="red">*</span>缴费时间：</label>
						<div class="layui-input-block">
							<input id="paymentDate" type="text" placeholder="请选择时间" class="layui-input layui-time-pr test-item1">
						</div>
					</div>
				</div>
				<div class="btn-con textCenter">
					<span onclick="chargeConfirm()" class="btn-two cursor">提交</span>
				</div>
			</div>
		</div>
	</div>

	<!-- 入驻合同弹窗 -->
	<div id="pop-contractLayerOpen" style="display: none;">
		<div class="pop-up">
			<div>
				<div class="pop-title relative overflow mb15px">
					<span class="ml15px">入住时间</span>
					<p class="right"><img src="../static/elderlyInfo/img/close_icon.png" class="block pop-close"><p>
				</div>
				<div class="pop-form pop-form-assess mt30px mb30px">
					<div class="layui-form-item">
						<label class="layui-form-label border-box"><span class="red">*</span>入住时间：</label>
						<div class="layui-input-block">
							<input id="startDate" type="text" placeholder="请选择" class="layui-input layui-time-pr test-item2">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label border-box"><span class="red">*</span>合同截止时间：</label>
						<div class="layui-input-block">
							<input id="endDate" type="text" placeholder="请选择" class="layui-input layui-time-pr test-item3">
						</div>
					</div>
					<div class="layui-form-item">
						<p onclick="renewalContractLayerOpen()" class="green border-radius4 textCenter lh32px" style="border: 1px dashed #ddd;">
							<img src="../static/elderlyInfo/img/icon_xuqian.png" style="vertical-align: -2px;" class="mr5px">续签合同
						</p>
					</div>
				</div>
				<div class="btn-con textCenter">
					<span  onclick="contractConfirm()"  class="btn-two cursor">提交</span>
				</div>
			</div>
		</div>
	</div>




	<!-- 入驻合同弹窗-续签合同 renewalContractLayerOpen -->
	<div id="pop-renewalContractLayerOpen" style="display: none;">
		<div class="pop-up">
			<div>
				<div class="pop-title relative overflow mb15px">
					<span class="ml15px">合同情况</span>
					<p class="right"><img src="../static/elderlyInfo/img/close_icon.png" class="block pop-close"><p>
				</div>
				<div class="pop-form pop-form-nurse mt30px mb30px">
					<div class="layui-form-item">
						<label class="layui-form-label border-box"><span class="red">*</span>续签合同截止时间：</label>
						<div class="layui-input-block">
							<input id="renewEndDate" type="text" placeholder="持有残疾证" class="layui-input layui-time-pr test-item4">
						</div>
					</div>
				</div>
				<div class="btn-con textCenter">
					<span onclick="renewalContractConfirm()" class="btn-two cursor">提交</span>
				</div>
			</div>
		</div>
	</div>

	<!-- 床位编辑弹窗  -->  
	<div id="pop-buildingRoomBedLayerOpen" style="display: none;">
		<div class="pop-up">
			<div>
				<div class="pop-title relative overflow mb15px">
					<span class="ml15px">房间信息</span>
					<p class="right"><img src="../static/elderlyInfo/img/close_icon.png" class="block pop-close"><p>
				</div>
				<div class="pop-form pop-form-assess mt30px mb30px">
					<div class="layui-form-item">
						<label class="layui-form-label border-box"><span class="red">*</span>楼苑：</label>
						<div class="layui-input-block">
							<select name="" id="buildingNo" class="form-select-pr pl10px">
								<option value="">请选择</option>
								<option th:each="list:${buildingList}" th:value="${list.buildingNo}"  th:text="${list.buildingName}"></option>
							</select>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label border-box"><span class="red">*</span>楼层：</label>
						<div class="layui-input-block">
							<select name="" id="floorNo" class="form-select-pr pl10px">
								<option value="">请选择</option>
							</select>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label border-box"><span class="red">*</span>房间号：</label>
						<div class="layui-input-block">
							<select name="" id="roomNo" class="form-select-pr pl10px">
								<option value="">请选择</option>
							</select>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label border-box"><span class="red">*</span>床位：</label>
						<div class="layui-input-block">
							<select name="" id="bedNo" class="form-select-pr pl10px">
								<option value="">请选择</option>
							</select>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label border-box"><span class="red">*</span>床位费标准：</label>
						<div class="layui-input-block">
							<select name="" id="bedFeeType" class="form-select-pr pl10px">
								<option value="">请选择</option>
								<option th:each="list:${pageData.bedFeeTypeList}" th:value="${list.costNo}"  th:text="${list.costPrice}"></option>
							</select>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label border-box"><span class="red">*</span>床位生效时间：</label>
						<div class="layui-input-block">
							<input id="effectDate" type="text" placeholder="请选择" class="layui-input layui-time-pr test-item5">
						</div>
					</div>
				</div>
				<div class="btn-con textCenter">
					<span onclick="buildingRoomBedConfirm()" class="btn-two cursor">提交</span>
				</div>
			</div>
		</div>
	</div>


 

	<!-- 护理等级信息 弹框-->
	<div id="pop-nursingLayerOpen" style="display: none;">
		<div class="pop-up">
			<div>
				<div class="pop-title relative overflow mb15px">
					<span class="ml15px">护理等级信息</span>
					<p class="right"><img src="../static/elderlyInfo/img/close_icon.png" class="block pop-close"><p>
				</div>
				<div class="pop-form pop-form-assess pop-form-nurse mt30px mb30px">
					<div class="layui-form-item">
						<label class="layui-form-label border-box"><span class="red">*</span>护理等级：</label>
						<div class="layui-input-block">
							<select name="" id="nursingCostNo" class="form-select-pr pl10px">
								<option value="">请选择</option>
								<option th:each="list:${pageData.nursingCostList}" th:value="${list.costNo}"  th:text="${list.costName}"></option>
							</select>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label border-box"><span class="red">*</span>护理评估生效时间：</label>
						<div class="layui-input-block">
							<input type="text" id="nursingEffectDate" placeholder="请选择" class="layui-input layui-time-pr test-item6">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label border-box"><span class="red">*</span>护理人员：</label>
						<div class="layui-input-block">
							<input onclick="staffInfoLayerOpen()" id="staffName" readonly="readonly"  type="text" placeholder="请输入" class="layui-input">
							<input type="hidden" id="staffNo" value="" name="">
							<span style="position: absolute; right: 0; top: 6px; height: 32px; padding: 0 10px;"><img src="../static/elderlyInfo/img/icon_hlry.png" alt=""></span>
						</div>
					</div>
				</div>
				<div class="btn-con textCenter">
					<span onclick="nursingConfirm()" class="btn-two cursor">提交</span>
				</div>
			</div>

		</div>
	</div>

	<!-- //护理人员选择 -->
	<div id="pop-con" style="display: none;">
		<div class="pop-up">
			<div>
				<div class="pop-title relative overflow mb15px">
					<span class="ml15px">护理员</span>
					<!-- <p class="right"><img src="../static/elderlyInfo/img/close_icon.png" class="block pop-close"><p> -->
				</div>
				<div class="border-top1px mt10px">
					<div class="overflow mt20px mb20px lh32px">
						<p class="left">共有<span id="totalNum" class="red"></span>条数据</p>
						<div class="add-mess-form-border right relative ml30px">
							<p><input id="searchStaffName" type="text" placeholder="请输入"></p>
							<span onclick="getStaffInfoList()"><img src="../static/elderlyInfo/img/icon_search.png"></span>
						</div>
					</div>
					<article class="pop-box">
						<div class="pop-box-scroll">
							<div class="border1px border-radius4">
								<table class="layui-hide" id="test2" lay-filter="test2"></table>
							</div>
						</div>
					</article>
				</div>
				<div class="btn-con btn-con-position textCenter mt20px">
					<span class="btn-one cursor" onclick="cancelOfLayerOpen()">取&nbsp;消</span>
					<span class="btn-two cursor" onclick="confirmOfLayerOpen()">提&nbsp;交</span>
				</div>
			</div>
		</div>
	</div>


 
	<!-- 长护险等级编辑弹窗 --> 
	<div id="pop-assessmentLayerOpen" style="display: none;">
		<div class="pop-up">
			<div>
				<div class="pop-title relative overflow mb15px">
					<span class="ml15px">长护险等级信息</span>
					<p class="right"><img src="../static/elderlyInfo/img/close_icon.png" class="block pop-close"><p>
				</div>
				<div class="pop-form pop-form-assess mt30px mb30px">
					<div class="layui-form-item">
						<label class="layui-form-label border-box"><span class="red">*</span>评估等级：</label>
						<div class="layui-input-block">
							<select name="" id="assessmentCostNo" class="form-select-pr pl10px">
								<option value="">请选择</option>
								<option th:each="list:${pageData.assessmentCostList}" th:value="${list.costNo}"  th:text="${list.costName}"></option>
							</select>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label border-box"><span class="red">*</span>评估有效期：</label>
						<div class="layui-input-block">
							<input id="assessmentValidDate" type="text" placeholder="请选择" class="layui-input layui-time-pr test-item7">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label border-box"><span class="red">*</span>评估生效时间：</label>
						<div class="layui-input-block">
							<input id="assessmentEffectDate" type="text" placeholder="请选择" class="layui-input layui-time-pr test-item8">
						</div>
					</div>
				</div>
				<div class="btn-con  textCenter">
					<span onclick="assessmentConfirm()" class="btn-two cursor">提交</span>
				</div>
			</div>
		</div>
	</div>


	<!-- 养老院信息-退住弹窗 -->
	<div id="pop-isStayBackLayerOpen" style="display: none;">
		<div class="pop-up">
			<div>
				<div class="pop-title relative overflow mb15px">
					<span class="ml15px">办理退住</span>
					<p class="right"><img src="../static/elderlyInfo/img/close_icon.png" class="block pop-close"><p>
				</div>
				<div class="pop-form pop-form-right mt30px mb30px">
					<div class="layui-form-item">
						<label class="layui-form-label border-box"><span class="red">*</span>退住时间：</label>
						<div class="layui-input-block">
							<input id="stayBackDate" type="text" placeholder="请选择" class="layui-input layui-time-pr test-item9">
						</div>
					</div>
					<div class="layui-form-item"> 
						<label class="layui-form-label border-box"><span class="red">*</span>退住理由：</label>
						<div class="layui-input-block">
							<select name="" id="stayBackReason" class="form-select-pr pl10px">
								<option value ="">请选择</option>
								<option th:each="list:${stayBackReason}" th:value="${list.value}"  th:text="${list.name}"></option>
							</select>
						</div>
					</div>
					<div id="deathDiv" style="display: none;" class="layui-form-item">
						<label class="layui-form-label border-box">死亡时间：</label>
						<div class="layui-input-block">
							<input id="deathDate" type="text" placeholder="请选择" class="layui-input layui-time-pr test-item10">
						</div>
					</div>
				</div>
				<div class="btn-con textCenter">
					<span onclick="cancelIsStayBackLayer()" class="btn-one cursor">取消</span>
					<span onclick="isStayBackConfirm()" class="btn-two cursor">提交</span>
				</div>
			</div>
		</div>
	</div>


	<!-- 历史记录 -->
	<div id="pop-historyLayerOpen" style="display: none;"> 
		<div class="pop-up">
			 <div>
				<div class="pop-title relative overflow mb15px">
					<span class="ml15px" id="historyName"></span>
					<p class="right"><img src="../static/elderlyInfo/img/close_icon.png" class="block pop-close"><p>
				</div>
				<nav class="history-list mb20px border-top1px mt15px">
					<article>
						<ul class="add-box-scroll pr20px" id="historyDiv">
							<!-- <li class="border-bot1px">
								<div>
									<span>1</span>
								</div>
								<div>
									<p class="fb">文参果 创建 入住信息为【2009-03-03 ～ 2011-03-03】</p>
									<p class="gray">更新时间：2004-03-01 13:00:00</p>
								</div>
							</li>
							<li class="border-bot1px">
								<div>
									<span>1</span>
								</div>
								<div>
									<p class="fb">文参果 创建 入住信息为【2009-03-03 ～ 2011-03-03】</p>
									<p class="gray">更新时间：2004-03-01 13:00:00</p>
									<p class="gray overflow">
										<span class="left">更新时间：2004-03-01 13:00:00</span>
										<span class="right span-bgGreen">已生效</span>
									</p>
								</div>
							</li>
							<li class="border-bot1px">
								<div>
									<span>1</span>
								</div>
								<div>
									<p class="fb">文参果 创建 入住信息为【2009-03-03 ～ 2011-03-03】</p>
									<p class="gray overflow">
										<span class="left">更新时间：2004-03-01 13:00:00</span>
										<span class="right span-bgGray">已生效</span>
									</p>
								</div>
							</li> -->
						</ul>
					</article>
				</nav>
			</div> 
		</div>
	</div>






	<div id="pop-nursingLevelPicLayerOpen" style="display: none;"> 
		<div class="pop-up">
			<!-- 查看护理等级 -->
			<div>
				<div class="pop-title relative overflow mb15px">
					<span class="ml15px">护理等级</span>
					<p class="right"><img src="../static/elderlyInfo/img/close_icon.png" class="block pop-close"><p>
				</div>
				<div class="mt10px">
					<p><img id="nursingPic" src="../static/elderlyInfo/img/qing_img.png" alt=""></p>
					<!-- <p><img src="../static/elderlyInfo/img/zhong_img.png" alt=""></p>
					<p><img src="../static/elderlyInfo/img/zhongdu_img.png" alt=""></p> -->
				</div>
			</div>
		</div>
	</div>
<script src="../static/elderlyInfo/main/js/jquery-2.1.3.min.js"></script>
<script src="../static/elderlyInfo/main/layui/layui.js" charset="utf-8"></script>
<script>
	$(function(){

		layui.use(['element'  , 'table' , 'layer' , 'laydate' ], function() {
			var laydate = layui.laydate;
			laydate.render({
				elem: '.test-item1',
				trigger: 'click',
			});
			var start = laydate.render({
				elem: '.test-item2',
				done: function(value, date, endDate){
					if(value!=""){
						date.month=date.month-1;
						end.config.min=date;
					}else{
						end.config.min=start.config.min;
					}
				}
			});
			var end = laydate.render({
				elem: '.test-item3',
				done : function(value, date, endDate){
					if(value!=""){
						 date.month=date.month-1;
						 end.config.min=date;
						 start.config.max=end.config.min;
					}else{
						end.config.min=start.config.min;
					}
				}
			});

			//续签合同设计两年后
			var dateA=new Date($("#oldEndDate").val());
			dateA.setFullYear(dateA.getFullYear()+2);
			var dd = (dateA.getDate()+"").length==1?"0"+dateA.getDate():dateA.getDate();
			var defaultEndDate  =  dateA.getFullYear() + '-' + (dateA.getMonth() + 1) + '-' + dd;
			$("#renewEndDate").val(defaultEndDate);
			laydate.render({
				elem: '.test-item4',
				trigger: 'click',
				min:$("#oldEndDate").val(),
			});


			laydate.render({
				elem: '.test-item5',
				trigger: 'click',
				// min:'nowTime',//默认最大值为当前日期
			});

			laydate.render({
				elem: '.test-item6',
				trigger: 'click',
				// min:'nowTime',//默认最大值为当前日期
			});

			laydate.render({
				elem: '.test-item7',
				trigger: 'click',
			});

			laydate.render({
				elem: '.test-item8',
				trigger: 'click',
				// min:'nowTime',//默认最大值为当前日期
			});

			laydate.render({
				elem: '.test-item9',
				trigger: 'click',
			});

			laydate.render({
				elem: '.test-item10',
				trigger: 'click',
			});

		});
		//选中样式
		$('.layui-tab-title li').click(function() {
			//$(this).addClass('current').siblings().removeClass('current');
			// console.log($(this).attr("value"));
			if (1==$(this).attr("value")) {
				$("#baseInfoDiv").css("display","");
				$("#beadHouseDiv").css("display","none");
			}else if(2==$(this).attr("value")){
				$("#beadHouseDiv").css("display","none");
				$("#beadHouseDiv").css("display","");
			}
		});

		//楼苑--》楼层
		$("#buildingNo").change(function () {
           	getFloorOption();
        });

        //楼层--》房间号
		$("#floorNo").change(function () {
           	getRoomOption();
        });

        //房间号--》床位号
		$("#roomNo").change(function () {
           	getBedOption();
        });



		//退住理由
		$("#stayBackReason").change(function () {
			var optionText = $("#stayBackReason option:checked").text();
			if ("死亡"==optionText) {
				$("#deathDiv").css("display","");
			}else{
				$("#deathDiv").css("display","none");
			}
           	// console.log($("#stayBackReason option:checked").text());
           	// console.log($("#stayBackReason").val());

        });



	})


	//获取楼层信息
	function getFloorOption(){
		var buildingNo = $("#buildingNo").val();
		if (isNull(buildingNo)) {
			$("#floorNo").val("");
 			$("select[id='floorNo']").html("<option value=\"\">请选择</option>");
			$("#roomNo").val("");
			$("select[id='roomNo']").html("<option value=\"\">请选择</option>");
			$("#bedNo").val("");
			$("select[id='bedNo']").html("<option value=\"\">请选择</option>");
			return;
		}
		var optInit = "";
        var opt = "";
		var formDate =
	        {
	        	buildingNo : buildingNo
	        };
		$.ajax({
            url: "../elderlyInfo/getFloorByBuildingNo",
            type: "get",
            dataType: "json",
            data: formDate,
            async: false,
            success: function (res) {
                if (res.code == "200") {
                    optInit += "<option value=\"\">请选择</option>";
                    for (var i = 0; i < res.data.length; i++) {
                        opt += "<option value=" + res.data[i].floorNo + ">" + res.data[i].floorName + "</option>";
                    }
                    // 选择下拉菜单
                    var select = $("select[id='floorNo']");
                    // 拼接下拉菜单
                    if (!isNull(opt)) {
                        select.html(optInit + opt);
                    } else {
                        select.html(optInit);
                    }
                } else {
                	layer.msg("获取楼层信息失败，请稍后重试", {icon: 2,time:1500});
                }
            }
        });
	}


	//获取房间信息
	function getRoomOption(){
		var floorNo = $("#floorNo").val();
		if (isNull(floorNo)) {
			$("#roomNo").val("");
			$("select[id='roomNo']").html("<option value=\"\">请选择</option>");
			$("#bedNo").val("");
			$("select[id='bedNo']").html("<option value=\"\">请选择</option>");
			return;
		}
		var optInit = "";
        var opt = "";
		var formDate =
	        {
	        	floorNo : floorNo
	        };
		$.ajax({
            url: "../elderlyInfo/getRoomByFloorNo",
            type: "get",
            dataType: "json",
            data: formDate,
            async: false,
            success: function (res) {
                if (res.code == "200") {
                    optInit += "<option value=\"\">请选择</option>";
                    for (var i = 0; i < res.data.length; i++) {
                        opt += "<option value=" + res.data[i].roomNo + ">" + res.data[i].roomName + "</option>";
                    }
                    // 选择下拉菜单
                    var select = $("select[id='roomNo']");
                    // 拼接下拉菜单
                    if (!isNull(opt)) {
                        select.html(optInit + opt);
                    } else {
                        select.html(optInit);
                    }

                } else {
                	layer.msg("获取房间信息失败，请稍后重试", {icon: 2,time:1500});
                }
            }
        });
	}

	//获取床位信息
	function getBedOption(){
		var roomNo = $("#roomNo").val();
		if (isNull(roomNo)) {
			$("#bedNo").val("");
			$("select[id='bedNo']").html("<option value=\"\">请选择</option>");
			return;
		}
		var optInit = "";
        var opt = "";
		var formDate =
	        {
	        	roomNo : roomNo
	        };
		$.ajax({
            url: "../elderlyInfo/getBedByRoomNo",
            type: "get",
            dataType: "json",
            data: formDate,
            async: false,
            success: function (res) {
                if (res.code == "200") {
                    optInit += "<option value=\"\">请选择</option>";

                    for (var i = 0; i < res.data.length; i++) {
                        opt += "<option value=" + res.data[i].bedNo + ">" + res.data[i].bedName + "</option>";
                    }
                    // 选择下拉菜单
                    var select = $("select[id='bedNo']");
                    // 拼接下拉菜单
                    if (!isNull(opt)) {
                        select.html(optInit + opt);
                    } else {
                        select.html(optInit);
                    }

                } else {
                	layer.msg("获取床位信息失败，请稍后重试", {icon: 2,time:1500});
                }
            }
        });
	}



	//护理员弹框
	var staffLayerIndex ;
	function staffInfoLayerOpen(){
		layui.use(['element' , 'form' , 'table' , 'laydate' , 'layer'], function() {
			var layer = layui.layer;
			staffLayerIndex = layer.open({
					type: 1,
					title: false, //不显示标题栏
					closeBtn: false,
					area: ['800px', '600px'],
					shade: 0.6,
					id: 'payCons', //设定一个id，防止重复弹出
					/*,btn: ['确认支付']*/
					btnAlign: 'c',
					moveType: 1, //拖拽模式，0或者1
					shadeClose: true, //设置允许点遮罩关闭
					content: $("div#pop-con"),
					success: function() {
						getStaffInfoList();
						//关闭弹层
						$(".pop-close").click(function() {
							layer.closeAll();
						});
					},
				
				});
		})
	}

	//弹层的 取消 按钮
	var staffNo = "";
	var staffName ="";
	function cancelOfLayerOpen(){

		// staffNo ="";
		// staffName ="";
		$("#searchStaffName").val("");
		layer.close(staffLayerIndex);
	}

	//弹层的 提交 按钮
	function confirmOfLayerOpen(){
		//给input框赋值
		$("#staffName").val(staffName);
		$("#staffNo").val(staffNo);
		$("#searchStaffName").val("");
		layer.close(staffLayerIndex);
	}



	//获取护理员信息
	function getStaffInfoList(){
		//左侧菜单栏
		layui.use(['table'], function() {
			var table = layui.table;
			var searchStaffName = $("#searchStaffName").val();
		 	var formDate =
	        {
	        	staffName : searchStaffName
	        };

			//第一个实例
			table.render({
				elem: '#test2'//,url: '/demo/table/user/'
				,url:"../elderlyInfo/getYlStaffInfoList"
				,where:formDate
				,request: {
					 pageName: 'currentPage' //页码的参数名称，默认：page
					 ,limitName: 'pageSize' //每页数据量的参数名，默认：limit
				}
				//,count: 10  //数据总数，从服务端得到
				//,data: listData
				,page: true //开启分页
				,limit:10 //每页显示的条数
				//,limits:[3,4,5]
				,groups: 3 //连续页码个数
				,parseData:function(res){
						return{
							"code":res.code,
							"data":res.data.data,
							"count":res.data.totalCount,
							"limit":res.data.pageSize,
						};
				}
				,cols: [
					[ 
						{
							type: 'radio',
						},
						{
							field: 'staffName',
							title: '姓名',
						}, {
							field: 'post',
							title: '岗位',
						}
					]
				]
				,done:function(res, curr, count){
				    $("#totalNum").text(count);

				    //监听事件
				    table.on('radio(test2)', function(obj){
						//查看obj结构 console.log(obj); console.log(obj.checked);  //是否选中，选中为true
						//选中行的数据  
						// console.log(obj.data);
						staffNo = obj.data.staffNo;
						staffName = obj.data.staffName;
					});
				}
			});
		});

	}



	

	//返回列表
	function backList(){
		window.location.href="../elderlyInfo/jumpElderlyInfoList";
	}
	function back (){
		 window.history.back();
	}

	//编辑
	function  updateElderlyInfo(){
		var userNo = $("#userNo").val();
		window.location.href="../elderlyInfo/jumpElderlyInfoUpdate?userNo="+userNo;
		
	}


	//收费 弹框  
	function chargeLayerOpen(){
		layer.open({
			type: 1,
			title: false, //不显示标题栏
			closeBtn: false,
			area: ["$('div#pop-con') + width() + 'px'", ''],
			shade: 0.5,
			id: 'chargeLayerOpen', //设定一个id，防止重复弹出
			/*,btn: ['确认支付']*/
			btnAlign: 'c',
			moveType: 1, //拖拽模式，0或者1
			shadeClose: true, //设置允许点遮罩关闭
			content: $("div#pop-chargeLayerOpen"),
			success: function() {
				//关闭弹层
				$(".pop-close").click(function() {
					layer.closeAll();
				});
			},
		});
	}

	//修改费用 确认
	function chargeConfirm(){
		var userNo = $("#userNo").val();
		var inDeposit = $("#inDeposit").val();//入住保证金（元）
		var paymentDate = $("#paymentDate").val();//缴纳时间
		var costFee = $("#costFee").val();//收费情况（元）

		if (isNull(costFee)) {
			layer.msg("收费情况不能为空", {time: 2000});
			return;
		}
		if (isNull(inDeposit)) {
			layer.msg("入住保证金不能为空", {time: 2000});
			return;
		}
		if (isNull(paymentDate)) {
			layer.msg("缴纳时间不能为空", {time: 2000});
			return;
		}

		var formDate =
	        {
	        	userNo : userNo ,
	        	inDeposit : inDeposit ,
	        	paymentDate : paymentDate ,
	        	costFee : costFee ,
	        };
		$.ajax({
            url: "../elderlyInfo/updateYlElderlyInfoFee",
            type: "post",
            dataType: "json",
            data: formDate,
            async: false,
            success: function (res) {
                if (res.code == "200") {
                    layer.msg("修改成功", {icon: 1,time:1500},function(){
                    	layer.closeAll();
                    	location.reload();
                    });
                } else {
                	layer.msg(res.msg, {icon: 2,time:1500});
                }
            }
        });
	}


	//合同 弹框  
	function contractLayerOpen(){
		layer.open({
			type: 1,
			title: false, //不显示标题栏
			closeBtn: false,
			area: ["$('div#pop-con') + width() + 'px'", ''],
			shade: 0.5,
			id: 'contractLayerOpen', //设定一个id，防止重复弹出
			/*,btn: ['确认支付']*/
			btnAlign: 'c',
			moveType: 1, //拖拽模式，0或者1
			shadeClose: true, //设置允许点遮罩关闭
			content: $("div#pop-contractLayerOpen"),
			success: function() {
				//关闭弹层
				$(".pop-close").click(function() {
					layer.closeAll();
				});
			},
		});
	}

	//合同确认
	function contractConfirm(){
		var userNo = $("#userNo").val();
		var startDate = $("#startDate").val();//入住时间
		var endDate = $("#endDate").val();//合同截止时间

		if (isNull(startDate)) {
			layer.msg("入住时间不能为空", {time: 2000});
			return;
		}

		if (isNull(endDate)) {
			layer.msg("合同截止时间不能为空", {time: 2000});
			return;
		}

		var formDate =
	        {
	        	userNo : userNo ,
	        	startDate : startDate ,
	        	endDate : endDate 
	        };
		$.ajax({
            url: "../elderlyInfo/updateYlElderlyInfoContract",
            type: "post",
            dataType: "json",
            data: formDate,
            async: false,
            success: function (res) {
                if (res.code == "200") {
                    layer.msg("修改成功", {icon: 1,time:1500},function(){
                    	layer.closeAll();
                    	location.reload();
                    });
                } else {
                	layer.msg(res.msg, {icon: 2,time:1500});
                }
            }
        });
		
	}


	//续签合同
	function renewalContractLayerOpen(){
		layer.closeAll();
		layer.open({
			type: 1,
			title: false, //不显示标题栏
			closeBtn: false,
			area: ["$('div#pop-con') + width() + 'px'", ''],
			shade: 0.5,
			id: 'renewalContractLayerOpen', //设定一个id，防止重复弹出
			/*,btn: ['确认支付']*/
			btnAlign: 'c',
			moveType: 1, //拖拽模式，0或者1
			shadeClose: true, //设置允许点遮罩关闭
			content: $("div#pop-renewalContractLayerOpen"),
			success: function() {
				//关闭弹层
				$(".pop-close").click(function() {
					layer.closeAll();
				});
			},
		});
	}	

	//续签合同 确认
	function renewalContractConfirm(){
		var userNo = $("#userNo").val();
		var renewEndDate =  $("#renewEndDate").val(); //续签合同的截至日期
		if (isNull(renewEndDate)) {
			layer.msg("续签合同截止时间不能为空", {time: 2000});
			return;
		}


		var formDate =
	        {
	        	userNo : userNo ,
	        	renewEndDate : renewEndDate ,
	        };
		$.ajax({
            url: "../elderlyInfo/updateYlElderlyInfoContractOfRenewal",
            type: "post",
            dataType: "json",
            data: formDate,
            async: false,
            success: function (res) {
                if (res.code == "200") {
                    layer.msg("续签成功", {icon: 1,time:1500},function(){
                    	layer.closeAll();
                    	location.reload();
                    });
                } else {
                	layer.msg(res.msg, {icon: 2,time:1500});
                }
            }
        });
	}



	//床位信息弹框
	function buildingRoomBedLayerOpen(){
		layer.open({
			type: 1,
			title: false, //不显示标题栏
			closeBtn: false,
			area: ["$('div#pop-con') + width() + 'px'", ''],
			shade: 0.5,
			id: 'buildingRoomBedLayerOpen', //设定一个id，防止重复弹出
			/*,btn: ['确认支付']*/
			btnAlign: 'c',
			moveType: 1, //拖拽模式，0或者1
			shadeClose: true, //设置允许点遮罩关闭
			content: $("div#pop-buildingRoomBedLayerOpen"),
			success: function() {
				//关闭弹层
				$(".pop-close").click(function() {
					layer.closeAll();
				});
			},
		});

	}

	//床位信息 确认
	function buildingRoomBedConfirm(){
		var userNo = $("#userNo").val();
		var buildingNo = $("#buildingNo").val();//楼苑
		var floorNo = $("#floorNo").val();//楼层号
		var roomNo = $("#roomNo").val();//房间号
		var bedNo = $("#bedNo").val();//床位
		var bedFeeType = $("#bedFeeType").val();//床位费标准
		var effectDate = $("#effectDate").val();//床位 生效时间

		if (isNull(buildingNo)) {
			layer.msg("楼苑不能为空", {time: 2000});
			return;
		}

		if (isNull(floorNo)) {
			layer.msg("楼层号不能为空", {time: 2000});
			return;
		}
		if (isNull(roomNo)) {
			layer.msg("房间号不能为空", {time: 2000});
			return;
		}
		if (isNull(bedNo)) {
			layer.msg("床位不能为空", {time: 2000});
			return;
		}
		if (isNull(bedFeeType)) {
			layer.msg("床位费标准不能为空", {time: 2000});
			return;
		}
		if (isNull(effectDate)) {
			layer.msg("床位生效时间不能为空", {time: 2000});
			return;
		}

		var formDate =
	        {
	        	userNo : userNo ,
	        	buildingNo : buildingNo ,
	        	floorNo : floorNo ,
	        	roomNo : roomNo ,
	        	bedNo : bedNo ,
	        	bedFeeType : bedFeeType ,
	        	effectDate : effectDate ,
	        };
		$.ajax({
            url: "../elderlyInfo/updateYlElderlyInfoBuildingRoomBed",
            type: "post",
            dataType: "json",
            data: formDate,
            async: false,
            success: function (res) {
                if (res.code == "200") {
                    layer.msg("修改成功", {icon: 1,time:1500},function(){
                    	layer.closeAll();
                    	location.reload();
                    });
                } else {
                	layer.msg(res.msg, {icon: 2,time:1500});
                }
            }
        });
	}



	//护理等级
	function nursingLayerOpen (){
		layer.open({
			type: 1,
			title: false, //不显示标题栏
			closeBtn: false,
			area: ["$('div#pop-con') + width() + 'px'", ''],
			shade: 0.5,
			id: 'nursingLayerOpen', //设定一个id，防止重复弹出
			/*,btn: ['确认支付']*/
			btnAlign: 'c',
			moveType: 1, //拖拽模式，0或者1
			shadeClose: true, //设置允许点遮罩关闭
			content: $("div#pop-nursingLayerOpen"),
			success: function() {
				//关闭弹层
				$(".pop-close").click(function() {
					layer.closeAll();
				});
			},
		});
	}


	//护理等级 确认
	function nursingConfirm(){
		var userNo = $("#userNo").val();
		var nursingCostNo = $("#nursingCostNo").val();//护理等级
		var nursingEffectDate = $("#nursingEffectDate").val();//护理评估生效时间
		var staffNo = $("#staffNo").val();//护理人员
		if (isNull(nursingCostNo)) {
			layer.msg("护理等级不能为空", {time: 2000});
			return;
		}
		if (isNull(nursingEffectDate)) {
			layer.msg("护理评估生效时间不能为空", {time: 2000});
			return;
		}
		if (isNull(staffNo)) {
			layer.msg("护理人员不能为空", {time: 2000});
			return;
		}

		var formDate =
	        {
	        	userNo : userNo ,
	        	costNo : nursingCostNo ,
	        	effectDate : nursingEffectDate ,
	        	staffNo : staffNo ,
	        };
		$.ajax({
            url: "../elderlyInfo/updateYlElderlyInfoNursing",
            type: "post",
            dataType: "json",
            data: formDate,
            async: false,
            success: function (res) {
                if (res.code == "200") {
                    layer.msg("修改成功", {icon: 1,time:1500},function(){
                    	layer.closeAll();
                    	location.reload();
                    });
                } else {
                	layer.msg(res.msg, {icon: 2,time:1500});
                }
            }
        });
	}

	//长护险等级 弹框
	function assessmentLayerOpen(){
		layer.open({
			type: 1,
			title: false, //不显示标题栏
			closeBtn: false,
			area: ["$('div#pop-con') + width() + 'px'", ''],
			shade: 0.5,
			id: 'assessmentLayerOpen', //设定一个id，防止重复弹出
			/*,btn: ['确认支付']*/
			btnAlign: 'c',
			moveType: 1, //拖拽模式，0或者1
			shadeClose: true, //设置允许点遮罩关闭
			content: $("div#pop-assessmentLayerOpen"),
			success: function() {
				//关闭弹层
				$(".pop-close").click(function() {
					layer.closeAll();
				});
			},
		});
	}

	// 长护险等级 确认
	function assessmentConfirm(){
		var userNo = $("#userNo").val();
		var assessmentCostNo = $("#assessmentCostNo").val();//长护险等级
		var assessmentValidDate = $("#assessmentValidDate").val();//长护险有效期
		var assessmentEffectDate = $("#assessmentEffectDate").val();//评估生效时间
			

		if (isNull(assessmentCostNo)) {
			layer.msg("评估等级不能为空", {time: 2000});
			return;
		}
		if (isNull(assessmentValidDate)) {
			layer.msg("评估有效期不能为空", {time: 2000});
			return;
		}
		if (isNull(assessmentEffectDate)) {
			layer.msg("评估生效时间不能为空", {time: 2000});
			return;
		}

		var formDate =
	        {
	        	userNo : userNo ,
	        	costNo : assessmentCostNo ,
	        	validDate : assessmentValidDate ,
	        	effectDate : assessmentEffectDate ,
	        };
		$.ajax({
            url: "../elderlyInfo/updateYlElderlyInfoAssessment",
            type: "post",
            dataType: "json",
            data: formDate,
            async: false,
            success: function (res) {
                if (res.code == "200") {
                    layer.msg("修改成功", {icon: 1,time:1500},function(){
                    	layer.closeAll();
                    	location.reload();
                    });
                } else {
                	layer.msg(res.msg, {icon: 2,time:1500});
                }
            }
        });
	}

	//长护险等级 弹框
	function isStayBackLayerOpen(){
		layer.open({
			type: 1,
			title: false, //不显示标题栏
			closeBtn: false,
			area: ["$('div#pop-con') + width() + 'px'", ''],
			shade: 0.5,
			id: 'isStayBackLayerOpen', //设定一个id，防止重复弹出
			/*,btn: ['确认支付']*/
			btnAlign: 'c',
			moveType: 1, //拖拽模式，0或者1
			shadeClose: true, //设置允许点遮罩关闭
			content: $("div#pop-isStayBackLayerOpen"),
			success: function() {
				//关闭弹层
				$(".pop-close").click(function() {
					layer.closeAll();
				});
			},
		});
	}

	//退住 取消
	function cancelIsStayBackLayer(){
		layer.closeAll();
	}	

	//退住确认
	function isStayBackConfirm(){
		var userNo = $("#userNo").val();
		
		var stayBackDate = $("#stayBackDate").val();//退住时间
		var stayBackReason = $("#stayBackReason").val();//退住原因
		var deathDate = $("#deathDate").val();//死亡日期


		if (isNull(stayBackDate)) {
			layer.msg("退住时间不能为空", {time: 2000});
			return;
		}
		if (isNull(stayBackReason)) {
			layer.msg("退住原因不能为空", {time: 2000});
			return;
		}
		var formDate =
	        {
	        	userNo : userNo ,
	        	stayBackDate : stayBackDate ,
	        	stayBackReason : stayBackReason ,
	        	deathDate : deathDate ,
	        };
		$.ajax({
            url: "../elderlyInfo/updateElderlyForIsStayBack",
            type: "post",
            dataType: "json",
            data: formDate,
            async: false,
            success: function (res) {
                if (res.code == "200") {
                    layer.msg("修改成功", {icon: 1,time:1500},function(){
                    	layer.closeAll();
                    	window.location.href="../elderlyInfo/jumpElderlyInfoList";
                    });
                } else {
                	layer.msg(res.msg, {icon: 2,time:1500});
                }
            }
        });

		//办理退住时，判断是否欠费，如果欠费无法办理退住
	}


	//入住时间历史记录 
	function historyContractLayerOpen(){
		layer.open({
			type: 1,
			title: false, //不显示标题栏
			closeBtn: false,
			area: ["$('div#pop-con') + width() + 'px'", ''],
			shade: 0.5,
			id: 'historyLayerOpen', //设定一个id，防止重复弹出
			/*,btn: ['确认支付']*/
			btnAlign: 'c',
			moveType: 1, //拖拽模式，0或者1
			shadeClose: true, //设置允许点遮罩关闭
			content: $("div#pop-historyLayerOpen"),
			success: function() {
				getHistoryContractList();
				//关闭弹层
				$(".pop-close").click(function() {
					layer.closeAll();
				});
			},
		});
	}



	//入住时间历史记录 数据
	function getHistoryContractList(){
		var userNo = $("#userNo").val();
		var formDate =
	        {
	        	userNo : userNo 
	        };
		$.ajax({
            url: "../elderlyInfo/getHistoryContractList",
            type: "post",
            dataType: "json",
            data: formDate,
            async: false,
            success: function (res) {
                if (res.code == "200") {
                    if (isNull(res.data)) {
                    	return;
                    }
                    $("#historyName").text("入住时间历史记录");
                    //加载
                    var list = res.data;
                    var html="";
                    for (var i = 0; i < list.length; i++) {
                    	html+= '<li class="border-bot1px">';      
                    	html+= '<div>';
                    	html+= '<span>'+(i+1)+'</span>';
                    	html+= '</div>';
                    	html+= '<div>';
                    	html+= '<p class="fb">'+list[i].operationRecord+'</p>';
                    	html+= '<p class="gray">更新时间：'+list[i].formatCreateTime+'</p>';
                    	html+= '</div>';
                    	html+= '</li>';
                    }
                    $("#historyDiv").html(html);
                } else {
                	layer.closeAll();
                	layer.msg(res.msg, {icon: 2,time:1500});
                }
            }
        });
	}



	//床位历史记录
	function historyBedRecordLayerOpen(){
		layer.open({
			type: 1,
			title: false, //不显示标题栏
			closeBtn: false,
			area: ["$('div#pop-con') + width() + 'px'", ''],
			shade: 0.5,
			id: 'historyLayerOpen', //设定一个id，防止重复弹出
			/*,btn: ['确认支付']*/
			btnAlign: 'c',
			moveType: 1, //拖拽模式，0或者1
			shadeClose: true, //设置允许点遮罩关闭
			content: $("div#pop-historyLayerOpen"),
			success: function() {
				getHistoryBedRecordList();
				//关闭弹层
				$(".pop-close").click(function() {
					layer.closeAll();
				});
			},
		});
	}

	//床位历史记录 数据
	function getHistoryBedRecordList(){
		var userNo = $("#userNo").val();
		var formDate =
	        {
	        	userNo : userNo 
	        };
		$.ajax({
            url: "../elderlyInfo/getHistoryBedRecordList",
            type: "post",
            dataType: "json",
            data: formDate,
            async: false,
            success: function (res) {
                if (res.code == "200") {
                    if (isNull(res.data)) {
                    	return;
                    }
                    $("#historyName").text("床位历史记录");
                    //加载
                    var list = res.data;
                    var html="";
                    for (var i = 0; i < list.length; i++) {
                    	html+= '<li class="border-bot1px">';      
                    	html+= '<div>';
                    	html+= '<span>'+(i+1)+'</span>';
                    	html+= '</div>';
                    	html+= '<div>';
                    	html+= '<p class="fb">'+list[i].operationRecord+'</p>';
                    	html+= '<p class="gray">更新时间：'+list[i].formatCreateTime+'</p>';
						html+= '<p class="gray overflow">';
						if (list[i].isEffect==1) {
							html+= '<span class="right span-bgGreen">已生效</span>';
						}else if (list[i].isEffect==3) {
							html+= '<span class="right span-bgGray">未生效</span>';
						}
						html+= '</p>';
                    	html+= '</div>';
                    	html+= '</li>';
                    }
                    $("#historyDiv").html(html);
                } else {
                	layer.closeAll();
                	layer.msg(res.msg, {icon: 2,time:1500});
                }
            }
        });
	}


	//护理等级信息 历史记录
	function historyNursingRecordLayerOpen(){
		layer.open({
			type: 1,
			title: false, //不显示标题栏
			closeBtn: false,
			area: ["$('div#pop-con') + width() + 'px'", ''],
			shade: 0.5,
			id: 'historyLayerOpen', //设定一个id，防止重复弹出
			/*,btn: ['确认支付']*/
			btnAlign: 'c',
			moveType: 1, //拖拽模式，0或者1
			shadeClose: true, //设置允许点遮罩关闭
			content: $("div#pop-historyLayerOpen"),
			success: function() {
				getHistoryNursingRecordList();
				//关闭弹层
				$(".pop-close").click(function() {
					layer.closeAll();
				});
			},
		});
	}

	//护理等级信息 数据
	function getHistoryNursingRecordList(){
		var userNo = $("#userNo").val();
		var formDate =
	        {
	        	userNo : userNo 
	        };
		$.ajax({
            url: "../elderlyInfo/getHistoryNursingRecordList",
            type: "post",
            dataType: "json",
            data: formDate,
            async: false,
            success: function (res) {
                if (res.code == "200") {
                    if (isNull(res.data)) {
                    	return;
                    }
                    $("#historyName").text("护理等级信息历史记录");
                    //加载
                    var list = res.data;
                    var html="";
                    for (var i = 0; i < list.length; i++) {
                    	html+= '<li class="border-bot1px">';      
                    	html+= '<div>';
                    	html+= '<span>'+(i+1)+'</span>';
                    	html+= '</div>';
                    	html+= '<div>';
                    	html+= '<p class="fb">'+list[i].operationRecord+'</p>';
                    	html+= '<p class="gray">更新时间：'+list[i].formatCreateTime+'</p>';
						html+= '<p class="gray overflow">';
						if (list[i].isEffect==1) {
							html+= '<span class="right span-bgGreen">已生效</span>';
						}else if (list[i].isEffect==2) {
							html+= '<span class="right span-bgGray">未生效</span>';
						}
						html+= '</p>';
                    	html+= '</div>';
                    	html+= '</li>';
                    }

                    $("#historyDiv").html(html);
                } else {
                	layer.closeAll();
                	layer.msg(res.msg, {icon: 2,time:1500});
                }
            }
        });
	}


	//评估等级信息 历史记录 
	function historyAssessmentRecordLayerOpen(){
		layer.open({
			type: 1,
			title: false, //不显示标题栏
			closeBtn: false,
			area: ["$('div#pop-con') + width() + 'px'", ''],
			shade: 0.5,
			id: 'historyLayerOpen', //设定一个id，防止重复弹出
			/*,btn: ['确认支付']*/
			btnAlign: 'c',
			moveType: 1, //拖拽模式，0或者1
			shadeClose: true, //设置允许点遮罩关闭
			content: $("div#pop-historyLayerOpen"),
			success: function() {
				getHistoryAssessmentRecordList();
				//关闭弹层
				$(".pop-close").click(function() {
					layer.closeAll();
				});
			},
		});
	}


	//评估等级信息 历史 数据
	function getHistoryAssessmentRecordList(){
		var userNo = $("#userNo").val();
		var formDate =
	        {
	        	userNo : userNo 
	        };
		$.ajax({
            url: "../elderlyInfo/getHistoryAssessmentRecordList",
            type: "post",
            dataType: "json",
            data: formDate,
            async: false,
            success: function (res) {
                if (res.code == "200") {
                    if (isNull(res.data)) {
                    	return;
                    }
                    $("#historyName").text("长护险评估信息历史记录");
                    //加载
                    var list = res.data;
                    var html="";
                    for (var i = 0; i < list.length; i++) {
                    	html+= '<li class="border-bot1px">';      
                    	html+= '<div>';
                    	html+= '<span>'+(i+1)+'</span>';
                    	html+= '</div>';
                    	html+= '<div>';
                    	html+= '<p class="fb">'+list[i].operationRecord+'</p>';
                    	html+= '<p class="gray">更新时间：'+list[i].formatCreateTime+'</p>';
						html+= '<p class="gray overflow">';
						html+= '<span class="left">生效时间：'+list[i].effectDate+'</span>';
						if (list[i].isEffect==1) {
							html+= '<span class="right span-bgGreen">已生效</span>';
						}else if (list[i].isEffect==2) {
							html+= '<span class="right span-bgGray">未生效</span>';
						}
						html+= '</p>';
                    	html+= '</div>';
                    	html+= '</li>';
                    }
                    $("#historyDiv").html(html);
                } else {
                	layer.closeAll();
                	layer.msg(res.msg, {icon: 2,time:1500});
                }
            }
        });
	}


	//护理等级 弹框
	function nursingLevelPicLayerOpen(nursingCostNo){
		layer.open({
			type: 1,
			title: false, //不显示标题栏
			closeBtn: false,
			area: ["$('div#pop-con') + width() + 'px'", ''],
			shade: 0.5,
			id: 'nursingLevelPicLayerOpen', //设定一个id，防止重复弹出
			/*,btn: ['确认支付']*/
			btnAlign: 'c',
			moveType: 1, //拖拽模式，0或者1
			shadeClose: true, //设置允许点遮罩关闭
			content: $("div#pop-nursingLevelPicLayerOpen"),
			success: function() {
				getNursingLevelPic(nursingCostNo);
				//关闭弹层
				$(".pop-close").click(function() {
					layer.closeAll();
				});
			},
		});
	}

	//护理等级图片
	function getNursingLevelPic(nursingCostNo){

		var defaultPic = "../static/elderlyInfo/img/zhong_img.png";
		// console.log(nursingCostNo);

		var formDate =
	        {
	        	costNo : nursingCostNo 
	        };
		$.ajax({
            url: "../elderlyInfo/getCost",
            type: "post",
            dataType: "json",
            data: formDate,
            async: false,
            success: function (res) {
                if (res.code == "200") {
                	if (isNull(res.data)) {
                    	return;
                    }
                    // console.log(res);
                    var cost = res.data;
                    if (!isNull(cost.costImg)) {
                    	$("#nursingPic").attr("src",cost.costImg);
                    }else{
                    	$("#nursingPic").attr("src",defaultPic);
                    }
                     
                } else {
                	layer.closeAll();
                	layer.msg(res.msg, {icon: 2,time:1500});
                }
                   
            }
        });
	}




	function changeNum(obj) {
    	//如果用户第一位输入的是小数点，则重置输入框内容
	    if (obj.value != '' && obj.value.substr(0, 1) == '.') {
	        obj.value = "";
	    }
	    //粘贴不生效
	    obj.value = obj.value.replace(/^0*(0\.|[1-9])/, '$1'); 
	    //清除“数字”和“.”以外的字符
	    obj.value = obj.value.replace(/[^\d.]/g, "");  
	    //只保留第一个. 清除多余的
	    obj.value = obj.value.replace(/\.{2,}/g, ".");  
	    obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
	    //只能输入两个小数
	    obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); 
	    if (obj.value.indexOf(".") < 0 && obj.value != "") {
	        //以上已经过滤，此处控制的是如果没有小数点，首位不能为类似于 01、02的金额
	        if (obj.value.substr(0, 1) == '0' && obj.value.length == 2) {
	            obj.value = obj.value.substr(1, obj.value.length);
	        }
	    }
	}
	

	function isNull(value) {
		return value == null || value === "" || value === undefined;
	}

</script>
</body>

</html>
